<template>
  <view class="container">
    <view class="header_txt">
      <view class="back"
            @click="backHandler">
        <image src="/static/img/back3.png"></image>
      </view>
      <view class="title"> 问题反馈 </view>
    </view>
    <view class="content">
      <view class="list_box">
        <navigator class="list_item"
                   url="/pages/set/Safe">
          <view class="list_left">账号安全</view>
          <image class="list_r"
                 src="../../static/image/grzx_ico_jr_hui@2x.png"
                 mode=""></image>
        </navigator>
        <view class="list_item"
              @click="showModal"
              data-target="Modal">
          <view class="list_left">清除缓存</view>
          <image class="list_r"
                 src="../../static/image/grzx_ico_jr_hui@2x.png"
                 mode=""></image>
        </view>
        <view class="list_item">
          <view class="list_left">检查更新</view>
          <view class="list_right">v1.0.1</view>
        </view>
      </view>
      <view class="btn"
            @click="Loginout">退出登录</view>
      <view class="cu-modal"
            :class="modalName=='Modal'?'show':''">
        <view class="cu-dialog">
          <view class="cu_title">
            <view></view>
            <view class="text-bold cu-item-title1">清除缓存</view>
            <view class="action1"
                  @click="hideModal">
              <image src="../../static/image/ico_ts_gb@2x.png"
                     mode=""></image>
            </view>
          </view>
          <view class="padding_xl">
            <view class="cu_tip">确认清除APP浏览缓存？</view>
          </view>
          <view class="button">
            <view class="cu_btn"
                  @click="CleanApp">确定</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      modalName: null
    }
  },
  methods: {
    Loginout() {
      uni.removeStorageSync('account')
      uni.removeStorageSync('password')
      uni.removeStorageSync('userinfo')
      uni.navigateTo({
        url: '../login/login'
      })
    },
    hideModal() {
      this.modalName = null
    },
    CleanApp() {
      uni.clearStorageSync()
      this.hideModal()
      uni.redirectTo({
        url: '../login/login'
      })
    },
    showModal(e) {
      this.modalName = e.currentTarget.dataset.target
    },
    backHandler() {
      uni.navigateBack({
        delta: 1
      })
    }
  }
}
</script>

<style lang="scss">
.cu-modal {
  width: 750rpx;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1110;
  opacity: 0;
  outline: 0;
  text-align: center;
  -ms-transform: scale(1.185);
  -webkit-transform: scale(1.185);
  transform: scale(1.185);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-transition: all 0.3s ease-in-out 0s;
  transition: all 0.3s ease-in-out 0s;
  pointer-events: none;
}

.cu-modal.show {
  height: 100vh;
  padding-top: 70%;
  padding-left: 12%;
  opacity: 1;
  -webkit-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -ms-transform: scale(1);
  -webkit-transform: scale(1);
  transform: scale(1);
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: auto;
}
/* 头部区域 */
.header_txt {
  width: 750rpx;
  overflow: hidden;
  height: 88rpx;
  line-height: 88rpx;
  background-color: #fff;

  .back {
    position: absolute;
    top: 14rpx;
    left: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    image {
      width: 48rpx;
      height: 48rpx;
    }
  }

  .right {
    position: absolute;
    top: 14rpx;
    right: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .title {
    text-align: center;
    height: 88rpx;
    // margin-top: -20rpx;
    // line-height: 88rpx;
    font-size: 32rpx;
    font-weight: bold;
  }
}
.content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
}
.list_box {
  width: 100%;
  height: auto;
  margin-top: 20rpx;
}
.list_item {
  width: 100%;
  height: 100rpx;
  border-bottom: 1rpx solid #f5f5f5;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30rpx;
}
.list_kg {
  width: 56rpx;
  height: 26rpx;
}
.list_r {
  width: 12rpx;
  height: 22rpx;
}
.list_right {
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
}
.btn {
  width: 690rpx;
  height: 88rpx;
  background: #ffdd47;
  border-radius: 10rpx;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
  margin-top: 80rpx;
}
/* 弹窗 */
.cu-dialog {
  width: 570rpx;
  height: auto;
  background: #ffffff;
  border-radius: 10rpx;
}
.cu-item-title {
  font-size: 32rpx;
}

.cu-item-title1 {
  width: 100%;
  font-size: 32rpx;
  height: 100rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.action1 image {
  width: 29rpx;
  height: 29rpx;
}

.cu_title {
  width: 100%;
  height: 80rpx;
  padding: 0rpx 20rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f5f5f5;
}
.button {
  width: 100%;
  height: 100rpx;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cu_btn {
  width: 250rpx;
  height: 60rpx;
  background: #ffdd47;
  border-radius: 6rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.padding_xl {
  width: 100%;
  height: 120rpx;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}
.cu_start_box {
  width: 100%;
  height: 90rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cu_start_box image {
  width: 39rpx;
  height: 36rpx;
  margin-right: 10rpx;
}
.cu_close {
  width: 60rpx;
  height: 60rpx;
  position: absolute;
  bottom: 25%;
  right: 45%;
}
.cu_tip {
  font-size: 26rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #666666;
}
</style>

